<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('订单电费详情')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-orderitem-edit" th:object="${bizOrderItem}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">租户标识：</label>
                <div class="col-sm-8">
                    <input name="tenantId" th:field="*{tenantId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">客户ID：</label>
                <div class="col-sm-8">
                    <input name="customerId" th:field="*{customerId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单号：</label>
                <div class="col-sm-8">
                    <input name="orderNo" th:field="*{orderNo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">设备编号：</label>
                <div class="col-sm-8">
                    <input name="deviceSn" th:field="*{deviceSn}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">端口口：</label>
                <div class="col-sm-8">
                    <input name="devicePort" th:field="*{devicePort}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电费id：</label>
                <div class="col-sm-8">
                    <input name="goodsId" th:field="*{goodsId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电费名称：</label>
                <div class="col-sm-8">
                    <input name="goodsName" th:field="*{goodsName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">电费图片：</label>
                <input id="goodsDiagram" th:field="*{goodsDiagram}" class="form-control" type="hidden">
                <div class="col-sm-8" id="showImg">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电费数量：</label>
                <div class="col-sm-8">
                    <input name="goodsNum" th:field="*{goodsNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电费单价(元)：</label>
                <div class="col-sm-8">
                    <input name="goodsPrice" th:field="*{goodsPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结算单价(元)：</label>
                <div class="col-sm-8">
                    <input name="goodsCalcPrice" th:field="*{goodsCalcPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
        <div class="form-control-static" style="text-align:center;">
            <button th:onclick="'javascript:closeItem()'" class="btn btn-danger" type="button">关闭</button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">

        $(function (){
            var imgView = "";
            var attachment = $("#goodsDiagram").val();
            if(attachment != ''){
                var attachmentArr = attachment.split(",");
                for(a in attachmentArr){
                    imgView+="<img style='margin-top: 3px;' height='450px' src='"+attachmentArr[a]+"'><br>";
                }
            }else {
                imgView = "<input class='form-control' disabled type='text' value='暂无附件'>";
            }
            $("#showImg").html(imgView);
        })
        //使页面不可编辑
        function disableOcx() {
            var form = document.forms[0];
            for ( var i = 0; i < form.length; i++) {
                var element = form.elements[i];
                //部分元素可以编号 element.name 是元素自定义 name
                if (element.name != "auditEntity.auditContent"
                        && element.name != "auditEntity.auditAutograph"
                        && element.name != "auditEntity.auditTime"
                        && element.name != "auditEntity.auditState"
                        && element.name != "submitBtn"
                        && element.name != "reset"
                        && element.name != "id"
                        && element.name != "processInstanceId"
                        && element.name != "updateForm") {
                    element.disabled = "true";
                }
            }
        }
        window.onload = disableOcx;//当页面加载的时候执行此函数
        var prefix = ctx + "biz/orderitem";
    </script>
</body>
</html>